package net.cloudcodex.client.character.view;

import net.cloudcodex.client.widgets.VerticalTabLayoutPanel;

import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.logical.shared.HasBeforeSelectionHandlers;
import com.google.gwt.event.logical.shared.HasSelectionHandlers;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.inject.Inject;

public class CharactersViewImpl extends VerticalTabLayoutPanel implements CharactersView {

	private final Message message;

	@Inject
	public CharactersViewImpl(Message message) {
		super(120, Unit.PX);
		this.message = message;
	}

	@Override
	public int addCharacterView(IsWidget view, String tabName) {
		this.add(view, tabName);
		return this.getWidgetIndex(view);
	}

	@Override
	public void selectCharacterTab(Integer index) {
		this.selectTab(index);
	}
	
	@Override
	public HasSelectionHandlers<Integer> getCharactersTab(){
		return this;
	}
}
